package mvc.model.dao.impl;

import mvc.common.BaseDao;
import mvc.model.dao.CPUDao;
import mvc.model.pojos.CPUBean;

import java.util.List;

public class CPUDaoImpl implements CPUDao {
    private static BaseDao baseDao = new BaseDao();
    @Override
    public CPUBean query(int cpuid) {
        String sql = "SELECT * FROM cpu WHERE cpuid = ?;";
        List<CPUBean> query = baseDao.query(sql, CPUBean.class, cpuid);
        return query.isEmpty() ? null : query.get(0);
    }
}
